package com.dfiov.cloud.msmtools.mapper.dfadminMapper;

import com.dfiov.cloud.msmtools.mapper.entity.msmtools.OpUserAccount;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OpUserAccountMapper {

    @Select("<script> " +
            "SELECT * FROM op_user_account u " +
            "WHERE u.del_flag = 0 " +
            "<if test='accountname!=null'> AND u.account_name like #{accountname} </if> " +
            "<if test='phone!=null'> AND u.phone = #{phone} </if> " +
            "limit 1 " +
            "</script>")
    OpUserAccount getOpUserAccount(@Param("phone")String phone, @Param("accountname")String username);


    @Update("UPDATE op_user_account SET account_status = 0 WHERE account_name = #{accountname}")
    long updateOpUserAccountLockStatus(@Param("accountname")String accountname);

}
